﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
using Sunny.UI;
using Sunny.UI.Win32;

namespace RclSystem
{
    public partial class SalemanDialog : UIEditForm
    {
        public SalemanDialog()
        {
            InitializeComponent();
        }

        protected override bool CheckData()
        {
            return CheckEmpty(txt_saleman, "请输入业务员姓名");
        }

        private SalemanEntity saleman;

        public SalemanEntity SalemanEnity
        {
            get
            {
                if (saleman == null)
                {
                    saleman = new SalemanEntity();
                }

                saleman.name = txt_saleman.Text;
                saleman.phone = txt_phone.Text;               
                return saleman;
            }

            set
            {
                saleman = value;
                txt_saleman.Text = value.name;
                txt_phone.Text = value.phone;
            }
        }
    }
}
